﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ToursDetail : System.Web.UI.Page
{
    private static int tourID;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["tourID"] == null)
            return;
        else
            tourID = int.Parse(Request.QueryString["tourID"].ToString());

        LoadData();
    }
    private void LoadData()
    {
        DataTable dtTour = TourManagement.GetTourByID(tourID);
        dlDetailTour.DataSource = dtTour;
        dlDetailTour.DataBind();

        DataTable dtImages = ImageManagement.GetImgByForeignID(tourID, Common.IMAGE_TOUR).Tables[0];
        dlImageTour.DataSource = dtImages;
        dlImageTour.DataBind();

        DataTable dtOtherHotel = TourManagement.GetAllOtherTour(tourID).Tables[0];
        dlOtherTour.DataSource = dtOtherHotel;
        dlOtherTour.DataBind();
    }

    protected void lbtBack_Click(object sender, EventArgs e)
    {
        Response.Redirect("Tours.aspx");
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        LinkButton myButton = sender as LinkButton;
        if (myButton != null)
        {
            tourID = int.Parse(myButton.CommandArgument);

            //LoadData();
            Response.Redirect("ToursDetail.aspx?tourID=" + tourID);
        }
    }
}